<template>
	<view class="center">
		<view class="cebter-head">
			<view class="nav">
				<view 
				class="nav-list" 
				v-for="(item,index) in list" 
				:key="item.id" 
				@tap="changeAct(item)">
					<!-- 激活样式名字是红色 判断act==index 和act==item.id都行-->
					<view :class="[act==index?'name':'']">
						{{item.name}}
					</view>
					<!-- 名字下面的横线 -->
					<view :class="[act==index?'line':'']">
					</view>
				</view>
			</view>
					<!-- 内容的改变 -->
				<!-- 	<view class="content">
						<view class="">
							{{content.id}}
						</view>
						<view class="">
							{{content.name}}
						</view>
					</view> -->
		</view>
		<view v-show="content.id === 0" class="content">
			<view class="content-head">
				 <view class="iocn">
				 </view>
				 <view class="content-text">
					 <view class="text">
					 	<text>古茗奶茶</text>
					 </view>
					 <!-- 此处需要改变状态 -->
					<view class="text-complete">
						<text>待评价</text>
						<!-- <text>已完成</text> -->
					</view>
				 </view>
			</view>
			<view class="content-body">
				<view class="content-body-icon">
					<!-- 目前没图片 -->
					<!-- <img src="" > -->
				</view>
				<view class="content-body-right">
					<view class="content-body-text">
						<view class="content-body-name">
							<text>拿铁奶茶</text>
						</view>
						<view class="content-body-price">
							<text>￥29.00</text>
						</view>
					</view>
					<view class="content-body-text-two">
						<view class="content-body-name">
							<text>拿铁+布丁+珍珠+奶茶</text>
						</view>
						<view class="content-body-price">
							<text> ×1</text>
						</view>
					</view>
				</view>
			</view>
			<view class="content-bottom">
					<view class="text">
						<text>共1件商品</text>
						<text>实付款 ￥24.00</text>
					</view>
			</view>
			<view class="content-button-down ">
				<view class="content-button-down-operate button-sp-area">
					<button 
					class="newbutton" 
					type="default" 
					plain="true">删除记录</button>
					<button 
					class="newbutton" 
					type="primary" 
					plain="true">再次购买</button>
					<button  
					type="default" 
					plain="true">去评价</button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
								act: 0,
								list: [{
										id: 0,
										name: '全部'
									},
									{
										id: 1,
										name: '待付款'
									},
									{
										id: 2,
										name: '待发货'
									},
									{
										id: 3,
										name: '待收货'
									},
									{
										id: 4,
										name: '待评价'
									}
								],
								content: ''
			}
		},
		onShow() {
					this.content = this.list[0]
				},
		methods: {
			changeAct(item) {
							// 激活样式是当前点击的对应下标--list中对应id
							this.act = item.id;
							// 可以根据点击事件改变内容
							this.content = item
						}
		}
	}
</script>

<style lang="scss">
	.center {
		
		.cebter-head {
			margin-bottom: 20rpx;
			.nav {
					display: flex;
					align-items: center;
					justify-content: space-around;
					font-size: 30rpx;
					width: 750rpx;
					height: 86rpx;
					background: #FFFFFF;
					border-radius: 0rpx 0rpx 10rpx 10rpx;
					opacity: 1;
				}
				.nav-list {
					width: 100rpx;
					height: 100%;
					margin-top: 40rpx;
					opacity: .9;
				}
				.nav-list .name { 
					font-size: 28rpx;
					font-family: Source Han Sans CN-Medium, Source Han Sans CN;
					font-weight: 500;
					color: #F94D29;
				}
			
				.nav-list .line {
					margin-top: 24rpx;
					width: 70rpx;
					height: 4rpx;
					background: linear-gradient(90deg, #F94D29 0%, #F99529 100%);
					border-radius: 2rpx 2rpx 2rpx 2rpx;
					opacity: 1;
				}
		}
		/* 内容 */
		.content {
			padding: 20rpx 0 24rpx ;
			width: 750rpx;
			height: 476rpx;
			background: #FFFFFF;
			border-radius: 10rpx 10rpx 10rpx 10rpx;
			opacity: 1;
			.content-head {
				display: flex;
				margin: 36rpx 30rpx 38rpx ;
				.iocn {
					width: 28rpx;
					height: 27rpx;
					background: #222222;
					opacity: 1;
					margin:0 18rpx 0 0;
					
				}
				.content-text {
					width: 648rpx;
					display: flex;
					justify-content: space-between;
					.text {
						width: 112rpx;
						height: 28rpx;
						font-size: 28rpx;
						font-family: Source Han Sans CN-Regular, Source Han Sans CN;
						font-weight: 400;
						color: #222222;
						line-height: 28rpx;
					}
					.text-complete {
						width: 84rpx;
						height: 28rpx;
						font-size: 28rpx;
						font-family: Source Han Sans CN-Regular, Source Han Sans CN;
						font-weight: 400;
						color: #F94D29;
						line-height: 34rpx;
					}
				}
			}
			
			.content-body {
				margin: 0 28rpx 50rpx 30rpx ;
				display: flex;
				.content-body-icon {
					width: 160rpx;
					height: 160rpx;
					background: #FFFFFF;
					border-radius: 7rpx 7rpx 7rpx 7rpx;
					opacity: 1;
					border: 1rpx solid ;
					margin-right: 26rpx;
				}
				.content-body-right {
					margin-top: 16rpx;
					.content-body-text {
						width: 466rpx;
						display: flex;
						justify-content: space-between;
						margin-bottom: 20rpx;
						.content-body-name {
							width: 112rpx;
							height: 28rpx;
							font-size: 28rpx;
							font-family: Source Han Sans CN-Medium, Source Han Sans CN;
							font-weight: 500;
							color: #222222;
							line-height: 33rpx;
						}
						.content-body-price {
							width: 92rpx;
							height: 28rpx;
							font-size: 28rpx;
							font-family: Source Han Sans CN-Regular, Source Han Sans CN;
							font-weight: 400;
							color: #222222;
							line-height: 34rpx;
						}
					}
					.content-body-text-two {
						display: flex;
						justify-content: space-between;
						.content-body-name {
							width: 232rpx;
							height: 24rpx;
							font-size: 24rpx;
							font-family: Source Han Sans CN-Regular, Source Han Sans CN;
							font-weight: 400;
							color: #555555;
							line-height: 31rpx;
						}
						.content-body-price {
							width: 33rpx;
							height: 33rpx;
							font-size: 30rpx;
							font-family: Source Han Sans CN-Regular, Source Han Sans CN;
							font-weight: 400;
							color: #666666;
							line-height: 36rpx;
						}
					}
				}
			}
			.content-bottom {
				margin: 0 0 0 400rpx;
				.text :nth-child(1) {
					height: 28rpx;
					font-size: 28rpx;
					font-family: Source Han Sans CN-Regular, Source Han Sans CN;
					font-weight: 400;
					color: #555555;
					line-height: 34rpx;
					padding-right: 10rpx;
				}
				.text {
					height: 28rpx;
					font-size: 28rpx;
					font-family: Source Han Sans CN-Regular, Source Han Sans CN;
					font-weight: 400;
					color: #222222;
					line-height: 34rpx;
					
				}
			}
			.content-button-down {
				margin: 48rpx 30rpx 0 170rpx;
				.content-button-down-operate :nth-child(3) {
					width: 170rpx;
					height: 64rpx;
					background: rgba(0,0,0,0);
					border-radius: 31rpx 31rpx 31rpx 31rpx;
					opacity: 1;
					border: 2rpx solid #F94D29;
					
								
					font-size: 28rpx;
					font-family: Source Han Sans CN-Regular, Source Han Sans CN;
					font-weight: 400;
					color: #F94D29;
				}
				.content-button-down-operate {
					display: flex;
					
					.newbutton {
						height: 64rpx;
						border-radius: 31rpx 31rpx 31rpx 31rpx;
						opacity: 1;
						border: 2rpx solid #888888;
						text-align: center;
						line-height: 64rpx;
						
						font-size: 28rpx;
						font-family: Source Han Sans CN-Regular, Source Han Sans CN;
						font-weight: 400;
						color: #222222;
					}
				}
			}
		}
	}
</style>
